gtktextview: Fix a definite use of an uninitialised variable
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 20 Nov 2013 17:33:59 +0000 (17:33 +0000)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 9 Mar 2015 13:41:37 +0000 (13:41 +0000)
This seems to have been a typo in the original code, and allowed access
to virtual_cursor_y when it was uninitialised.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760

gtk/gtktextview.c

index a61dd1ed5ec19f5c2ceb005d1748f1af9b8e15b5..13bade8b85f0b396227e8bb03d1c4e03117cc72c 100644 (file)
@@ -8787,7 +8787,7 @@ gtk_text_view_get_virtual_cursor_pos (GtkTextView *text_view,
 
   if (y)
     {
-      if (priv->virtual_cursor_x != -1)
+      if (priv->virtual_cursor_y != -1)
         *y = priv->virtual_cursor_y;
       else
         *y = pos.y + pos.height / 2;